Skip to content

Conversation

@JDevlieghere
Copy link
Member

No description provided.

@JDevlieghere JDevlieghere enabled auto-merge (squash) November 18, 2025 00:23
@llvmbot llvmbot added the lldb label Nov 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 18, 2025

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/168464.diff

1 Files Affected:

  • (modified) lldb/bindings/lua/lua-typemaps.swig (+6-5)
diff --git a/lldb/bindings/lua/lua-typemaps.swig b/lldb/bindings/lua/lua-typemaps.swig
index f2a7401419368..a4a77b1a214c9 100644
--- a/lldb/bindings/lua/lua-typemaps.swig
+++ b/lldb/bindings/lua/lua-typemaps.swig
@@ -122,9 +122,9 @@ LLDB_NUMBER_TYPEMAP(enum SWIGTYPE);
 }
 
 // Disable default type checking for this method to avoid SWIG dispatch issues.
-// 
+//
 // Problem: SBThread::GetStopDescription has two overloads:
-//   1. GetStopDescription(char* dst_or_null, size_t dst_len) 
+//   1. GetStopDescription(char* dst_or_null, size_t dst_len)
 //   2. GetStopDescription(lldb::SBStream& stream)
 //
 // SWIG generates a dispatch function to select the correct overload based on argument types.
@@ -132,9 +132,9 @@ LLDB_NUMBER_TYPEMAP(enum SWIGTYPE);
 // However, this dispatcher doesn't consider typemaps that transform function signatures.
 //
 // In lua, our typemap converts GetStopDescription(char*, size_t) to GetStopDescription(int).
-// The dispatcher still checks against the original (char*, size_t) signature instead of 
+// The dispatcher still checks against the original (char*, size_t) signature instead of
 // the transformed (int) signature, causing type matching to fail.
-// This only affects SBThread::GetStopDescription since the type check also matches 
+// This only affects SBThread::GetStopDescription since the type check also matches
 // the argument name, which is unique to this function.
 %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER) (char *dst_or_null, size_t dst_len) ""
 
@@ -251,7 +251,8 @@ LLDB_NUMBER_TYPEMAP(enum SWIGTYPE);
 %typemap(in) lldb::FileSP {
   luaL_Stream *p = (luaL_Stream *)luaL_checkudata(L, $input, LUA_FILEHANDLE);
   lldb::FileSP file_sp;
-  file_sp = std::make_shared<lldb_private::NativeFile>(p->f, false);
+  file_sp = std::make_shared<lldb_private::NativeFile>(
+      p->f, lldb_private::NativeFile::eOpenOptionReadWrite, false);
   if (!file_sp->IsValid())
     return luaL_error(L, "Invalid file");
   $1 = file_sp;

@JDevlieghere JDevlieghere merged commit 186b8ba into llvm:main Nov 18, 2025
12 checks passed
@github-actions
Copy link

🐧 Linux x64 Test Results

  • 33130 tests passed
  • 490 tests skipped

@JDevlieghere JDevlieghere deleted the lua-typemap-fix branch November 18, 2025 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants